<!-- 房屋属性 -->

<template>
  <el-form
    ref="formRef"
    :model="form.data"
    :disabled="form.status==='r'||form.submitting"
    :label-width="form.show&&isActive?'auto':undefined"
    class="commodity-form-module"
  >
    <!-- 必选, 1. 数字类型 2. 范围0.1 ~ 2000 3. 精确度保留2位 -->
    <el-form-item
      label="房间面积(平方)"
      prop="roomInfo.roomArea"
      verify
    >
      <SafeInputNumber
        style="width: 100%"
        v-model="form.data.roomInfo.roomArea"
        :min="0.1"
        :max="2000"
        :precision="2"
        placeholder="请输入房间面积"
      />
    </el-form-item>

    <!-- 必选, 1. 整数类型 2. 范围-10 ~ 200  -->
    <el-form-item
      label="所在楼层"
      prop="roomInfo.floor"
    >
      <el-input
        class="show-word-limit"
        style="width: 100%"
        v-model="form.data.roomInfo.floor"
        show-word-limit
        maxlength="20"
        :precision="0"
        placeholder="请输入所在楼层"
      />
    </el-form-item>

    <!-- 必选, 1. 正整数类型 2. 范围1 ~ 100  -->
    <el-form-item
      label="可住人数"
      prop="roomInfo.personNum"
      verify
    >
      <SafeInputNumber
        style="width: 100%"
        v-model="form.data.roomInfo.personNum"
        :min="1"
        :max="100"
        :precision="0"
        placeholder="请输入可住人数"
      />
    </el-form-item>

    <div class="room-info-item">
      <el-form-item
        label="是否含早餐"
        prop="roomInfo.inBreakfast"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.inBreakfast"
        >
          <el-radio :label="1">含早餐</el-radio>
          <el-radio :label="0">无早餐</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="电视"
        prop="roomInfo.inTv"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.inTv"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="窗户"
        prop="roomInfo.inWindow"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.inWindow"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="阳台"
        prop="roomInfo.inBalcony"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.inBalcony"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="能否加床"
        prop="roomInfo.canExtraBed"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.canExtraBed"
        >
          <el-radio :label="1">可以</el-radio>
          <el-radio :label="0">不可以</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="WIFI"
        prop="roomInfo.inWifi"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.inWifi"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="空调"
        prop="roomInfo.inAir"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.inAir"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="电水壶"
        prop="roomInfo.kettle"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.kettle"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="咖啡壶/茶壶"
        prop="roomInfo.coffeePot"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.coffeePot"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="独立卫浴"
        prop="roomInfo.bathroom"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.bathroom"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="浴缸"
        prop="roomInfo.bathtub"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.bathtub"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="吹风机"
        prop="roomInfo.hairDrier"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.hairDrier"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="浴袍"
        prop="roomInfo.bathrobe"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.bathrobe"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="洗衣机"
        prop="roomInfo.washingMachine"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.washingMachine"
        >
          <el-radio :label="1">有</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>

    <div class="room-info-item">
      <el-form-item
        label="洗漱用品"
        prop="roomInfo.toiletry"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.toiletry"
        >
          <el-radio :label="1">免费</el-radio>
          <el-radio :label="2">收费</el-radio>
          <el-radio :label="0">无</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item
        label="房型"
        prop="roomInfo.houseType"
        verify
      >
        <el-radio-group
          v-model="form.data.roomInfo.houseType"
        >
          <el-radio :label="0">大床房</el-radio>
          <el-radio :label="1">标准间</el-radio>
          <el-radio :label="2">三人间</el-radio>
          <el-radio :label="3">套房</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>
  </el-form>
</template>

<script>
import mixin from './mixin'

export default {
  name: 'RoomAttributes',
  mixins: [mixin],
  data () {
    return {}
  },
  methods: {}
}
</script>

<style lang="scss" scoped>

</style>
